

<%@ page import="org.gtesoreria.Prestamo" %>
<html>
	
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Crear Prestamo</title>
    </head>
    <body>
        <div class="nav" style="display:none">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1>Cuotas del prestamo de ${prestamoInstance?.afiliado?.apellidoNombre }</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${prestamoInstance}">
            <div class="errors">
                <g:renderErrors bean="${prestamoInstance}" as="list" />
            </div>
            </g:hasErrors>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                        	<th >Cuota</th>
                        	<th >Monto</th>
                        	<th>Pagada</th>
                        	<th>Fecha Vencimiento</th>
                        	
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${prestamoInstance.cuotas}" status="i" var="cuota">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                        
                        	<td style="text-align:right">
                        		${i+1}/${prestamoInstance.cuotas.size()}
                        	</td>
                        	<td style="text-align:right"><g:formatNumber number="${cuota.monto}" type="number" minFractionDigits="2" maxFractionDigits ="2" roundingMode="HALF_UP" /></td>
                        	<td style="text-align:right"><g:formatBoolean boolean="${cuota?.isPagada}" true="Si" false="No"/></td>
                        	<td style="text-align:right"><g:formatDate date="${cuota?.fechaVencimiento}" format="MM-yyyy"/></td>
							                         
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
        </div>
    </body>
</html>
